package rad.framework.mda.generator.template.test.resources;

import rad.framework.mda.generator.util.*;

public class Embedded
{
  protected static String nl;
  public static synchronized Embedded create(String lineSeparator)
  {
    nl = lineSeparator;
    Embedded result = new Embedded();
    nl = null;
    return result;
  }

  public final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
  protected final String TEXT_1 = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + NL + "" + NL + "<deployment xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"" + NL + "            xsi:schemaLocation=\"urn:jboss:bean-deployer bean-deployer_1_0.xsd\"" + NL + "            xmlns=\"urn:jboss:bean-deployer\">" + NL + "   <bean name=\"Naming\" class=\"org.jnp.server.SingletonNamingServer\"/>" + NL + "" + NL + "   <bean name=\"InitialContextProperties\" class=\"java.util.Hashtable\">" + NL + "      <constructor>" + NL + "      <parameter class=\"java.util.Map\">" + NL + "            <map keyClass=\"java.lang.String\" valueClass=\"java.lang.String\">" + NL + "               <entry>" + NL + "                  <key>java.naming.factory.initial</key>" + NL + "                  <value>org.jnp.interfaces.NamingContextFactory</value>" + NL + "               </entry>" + NL + "               <entry>" + NL + "                   <key>java.naming.factory.url.pkgs</key>" + NL + "                   <value>org.jboss.naming:org.jnp.interfaces</value>" + NL + "               </entry>" + NL + "            </map>" + NL + "      </parameter>" + NL + "      </constructor>" + NL + "   </bean>" + NL + "" + NL + "   <bean name=\"java:comp/Initializer\" class=\"org.jboss.ejb3.embedded.JavaCompInitializer\">" + NL + "      <property name=\"jndiProperties\"><inject bean=\"InitialContextProperties\"/></property>" + NL + "   </bean>" + NL + "" + NL + "   <bean name=\"XidFactory\" class=\"org.jboss.tm.XidFactoryImpl\"/>" + NL + "" + NL + "   <bean name=\"XidFactoryMBean\" class=\"org.jboss.ejb3.embedded.XidFactoryMBean\">" + NL + "      <constructor>" + NL + "         <parameter class=\"org.jboss.tm.XidFactoryBase\">" + NL + "            <inject bean=\"XidFactory\"/>" + NL + "         </parameter>" + NL + "      </constructor>" + NL + "   </bean>" + NL + "" + NL + "   <bean name=\"TransactionManagerInitializer\" class=\"org.jboss.tm.TransactionManagerInitializer\">" + NL + "      <property name=\"xidFactory\"><inject bean=\"XidFactory\"/></property>" + NL + "      <property name=\"initialContextProperties\"><inject bean=\"InitialContextProperties\"/></property>" + NL + "   </bean>" + NL + "" + NL + "   <bean name=\"UserTransaction\" class=\"org.jboss.ejb3.embedded.UserTransactionImpl\">" + NL + "      <demand>TransactionManagerInitializer</demand>" + NL + "   </bean>" + NL + "" + NL + "   <bean name=\"UserTransactionBinding\" class=\"org.jboss.ejb3.embedded.JndiBinder\">" + NL + "      <property name=\"jndiProperties\"><inject bean=\"InitialContextProperties\"/></property>" + NL + "      <property name=\"target\"><inject bean=\"UserTransaction\"/></property>" + NL + "      <property name=\"bindTo\">UserTransaction</property>" + NL + "      <property name=\"serializable\">false</property>" + NL + "   </bean>" + NL + "" + NL + "" + NL + "   <bean name=\"TransactionManager\" class=\"java.lang.Object\">" + NL + "      <constructor factoryMethod=\"getTransactionManager\">" + NL + "         <factory bean=\"TransactionManagerInitializer\"/>" + NL + "      </constructor>" + NL + "   </bean>" + NL + "   <bean name=\"CachedConnectionManager\" class=\"org.jboss.resource.connectionmanager.CachedConnectionManagerReference\">" + NL + "      <property name=\"transactionManager\"><inject bean=\"TransactionManager\"/></property>" + NL + "   </bean>" + NL + "" + NL + "   <!--" + NL + "      <bean class=\"org.jboss.jdbc.HypersonicDatabase\"" + NL + "        name=\"jboss:service=Hypersonic,database=localDB\">" + NL + "        <property name=\"database\">localDB</property>" + NL + "        <property name=\"inProcessMode\">true</property>" + NL + "        <property name=\"dbDataDir\">.</property>" + NL + "      </bean>" + NL + "   -->" + NL + "" + NL + "   <bean name=\"DefaultDSBootstrap\" class=\"org.jboss.resource.adapter.jdbc.local.LocalTxDataSource\">" + NL + "      <property name=\"driverClass\">org.hsqldb.jdbcDriver</property>" + NL + "      <property name=\"connectionURL\">jdbc:hsqldb:.</property>" + NL + "      <property name=\"userName\">sa</property>" + NL + "      <property name=\"jndiName\">java:/DefaultDS</property>" + NL + "      <property name=\"minSize\">0</property>" + NL + "      <property name=\"maxSize\">10</property>" + NL + "      <property name=\"blockingTimeout\">1000</property>" + NL + "      <property name=\"idleTimeout\">100000</property>" + NL + "      <property name=\"transactionManager\"><inject bean=\"TransactionManager\"/></property>" + NL + "      <property name=\"cachedConnectionManager\"><inject bean=\"CachedConnectionManager\"/></property>" + NL + "      <property name=\"initialContextProperties\"><inject bean=\"InitialContextProperties\"/></property>" + NL + "   </bean>" + NL + "" + NL + "   <bean name=\"DefaultDS\" class=\"java.lang.Object\">" + NL + "      <constructor factoryMethod=\"getDatasource\">" + NL + "         <factory bean=\"DefaultDSBootstrap\"/>" + NL + "      </constructor>" + NL + "   </bean>" + NL + "   " + NL + "   <!--" + NL + "   -->" + NL + "   <bean name=\"DefaultDSBootstrap\" class=\"org.jboss.resource.adapter.jdbc.local.LocalTxDataSource\">" + NL + "      <property name=\"driverClass\">org.hsqldb.jdbcDriver</property>" + NL + "      <property name=\"connectionURL\">jdbc:hsqldb:.</property>" + NL + "      <property name=\"userName\">sa</property>" + NL + "      <property name=\"jndiName\">java:/DefaultDS</property>" + NL + "      <property name=\"minSize\">0</property>" + NL + "      <property name=\"maxSize\">10</property>" + NL + "      <property name=\"blockingTimeout\">1000</property>" + NL + "      <property name=\"idleTimeout\">100000</property>" + NL + "      <property name=\"transactionManager\"><inject bean=\"TransactionManager\"/></property>" + NL + "      <property name=\"cachedConnectionManager\"><inject bean=\"CachedConnectionManager\"/></property>" + NL + "      <property name=\"initialContextProperties\"><inject bean=\"InitialContextProperties\"/></property>" + NL + "   </bean>" + NL + "" + NL + "   <bean name=\"DefaultDS\" class=\"java.lang.Object\">" + NL + "      <constructor factoryMethod=\"getDatasource\">" + NL + "         <factory bean=\"DefaultDSBootstrap\"/>" + NL + "      </constructor>" + NL + "   </bean>" + NL + "" + NL + "   <bean name=\"";
  protected final String TEXT_2 = "DSBootstrap\" class=\"org.jboss.resource.adapter.jdbc.local.LocalTxDataSource\">" + NL + "      <property name=\"driverClass\">org.hsqldb.jdbcDriver</property>" + NL + "      <property name=\"connectionURL\">jdbc:hsqldb:.</property>" + NL + "      <!--      <property name=\"connectionURL\">jdbc:hsqldb:./hypersonic/localDB</property> -->" + NL + "      <property name=\"userName\">sa</property>" + NL + "      <property name=\"jndiName\">java:/";
  protected final String TEXT_3 = "DS</property>" + NL + "      <property name=\"minSize\">0</property>" + NL + "      <property name=\"maxSize\">10</property>" + NL + "      <property name=\"blockingTimeout\">1000</property>" + NL + "      <property name=\"idleTimeout\">100000</property>" + NL + "      <property name=\"transactionManager\"><inject bean=\"TransactionManager\"/></property>" + NL + "      <property name=\"cachedConnectionManager\"><inject bean=\"CachedConnectionManager\"/></property>" + NL + "      <property name=\"initialContextProperties\"><inject bean=\"InitialContextProperties\"/></property>" + NL + "   </bean>" + NL + "" + NL + "   <bean name=\"";
  protected final String TEXT_4 = "DS\" class=\"java.lang.Object\">" + NL + "      <constructor factoryMethod=\"getDatasource\">" + NL + "         <factory bean=\"";
  protected final String TEXT_5 = "DSBootstrap\"/>" + NL + "      </constructor>" + NL + "   </bean>" + NL + "" + NL + "   <bean class=\"rad.framework.jboss.MockPartition\" name=\"jboss:service=HAPartition\"/>" + NL + "" + NL + "   <bean name=\"HAPartitionBinding\" class=\"org.jboss.ejb3.embedded.JndiBinder\">" + NL + "      <property name=\"jndiProperties\"><inject bean=\"InitialContextProperties\"/></property>" + NL + "      <property name=\"target\"><inject bean=\"jboss:service=HAPartition\"/></property>" + NL + "      <property name=\"bindTo\">/HAPartition/DefaultPartition</property>" + NL + "      <property name=\"serializable\">false</property>" + NL + "   </bean>  " + NL + "" + NL + "</deployment>";

  public String generate(Object argument)
  {
    final StringBuffer stringBuffer = new StringBuffer();
    

    org.eclipse.uml2.uml.Model uml2Model = (org.eclipse.uml2.uml.Model) argument;
    stringBuffer.append(TEXT_1);
    stringBuffer.append(NameHelper.getCapName(uml2Model));
    stringBuffer.append(TEXT_2);
    stringBuffer.append(NameHelper.getCapName(uml2Model));
    stringBuffer.append(TEXT_3);
    stringBuffer.append(NameHelper.getCapName(uml2Model));
    stringBuffer.append(TEXT_4);
    stringBuffer.append(NameHelper.getCapName(uml2Model));
    stringBuffer.append(TEXT_5);
    return stringBuffer.toString();
  }
}
